#!/bin/sh
#
# Copyright (c) Nuvoton Technology Corp. All rights reserved.
#
# Read/Write server parameters

eval `/mnt/ESensor/htdocs/proccgi.sh $*`

cd /mnt/ESensor/

#用户配置文件路径
userConfigPath="/mnt/ESensor/etc/"

echo "Content-type: application/json"
echo ""

if [ "$FORM_doAction" == "read" ] ; then

#获取配置信息
varHOST=`cat /mnt/nand1-2/etc/.ESensor.user | awk '{FS="[:]+"} {print $3;exit}'`
varUSERID=`cat /mnt/nand1-2/etc/.ESensor.user | awk '{FS="[:]+"} {print $1;exit}'`
varPW=`cat /mnt/nand1-2/etc/.ESensor.user | awk '{FS="[:]+"} {print $2;exit}'`

cat << EOF
	{
		"HOST": "$varHOST",
		"USERID": "$varUSERID",
		"PW": "$varPW"
	}
EOF

fi

